package com.yulang.security.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * <p>
 * 系统 - 角色 - 菜单
 * </p>
 *
 * @author Administrator
 * @since 2020-08-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("cloud_role_menu")
public class CloudRoleMenu implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = ID, type = IdType.AUTO)
    private Long id;

    /**
     * 角色ID
     */
    @TableField(ROLE_ID)
    private Long roleId;

    /**
     * 菜单ID
     */
    @TableField(MENU_ID)
    private Long menuId;

    /**
     * 创建时间
     */
    @TableField(CREATE_TIME)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(UPDATE_TIME)
    private Date updateTime;

    /**
     * 创建者
     */
    @TableField(CREATE_USER)
    private String createUser;

    /**
     * 更新者
     */
    @TableField(UPDATE_USER)
    private String updateUser;


    public static final String ID = "`id`";

    public static final String ROLE_ID = "`role_id`";

    public static final String MENU_ID = "`menu_id`";

    public static final String CREATE_TIME = "`create_time`";

    public static final String UPDATE_TIME = "`update_time`";

    public static final String CREATE_USER = "`create_user`";

    public static final String UPDATE_USER = "`update_user`";


    public static final String ID_COMMENT = "主键";

    public static final String ROLE_ID_COMMENT = "角色ID";

    public static final String MENU_ID_COMMENT = "菜单ID";

    public static final String CREATE_TIME_COMMENT = "创建时间";

    public static final String UPDATE_TIME_COMMENT = "更新时间";

    public static final String CREATE_USER_COMMENT = "创建者";

    public static final String UPDATE_USER_COMMENT = "更新者";



    public static CloudRoleMenu of(Object obj) {
        CloudRoleMenu e = new CloudRoleMenu();
        BeanUtils.copyProperties(obj, e);
        return e;
    }

    public static QueryWrapper<CloudRoleMenu> queryWrapper(Object obj) {
        return new QueryWrapper<>(of(obj));
    }

}
